<?php $this->load->view('templates/header');?>

<div class="login-container">
    <div class="sub-container">
        <h2 style="text-align: center;"><?php echo lang('login_heading');?></h2>
        <p style="text-align: center;"><?php echo lang('login_subheading');?></p>
        
        <div id="infoMessage" style="color:red"><?php echo $message;?></div>
        
        <?php echo form_open("auth/login");?>
        
          <p>
            <?php echo lang('login_identity_label', 'identity');?>
            <?php echo form_input($identity, "", 'class="form-control username-field"');?>
          </p>
        
          <p>
            <?php echo lang('login_password_label', 'password');?>
            <?php echo form_input($password, "", 'class = "form-control password-field"');?>
          </p>
        
          <p>
            <?php echo lang('login_remember_label', 'remember');?>
            <?php echo form_checkbox('remember', '1', FALSE, 'id="remember"');?>
          </p>
        
        
          <p><?php //echo form_submit('submit', lang('login_submit_btn'));?></p>
          <button style="width:322px" class=" btn btn-primary btn-large" name="submit" type="submit" data-loading-text="請稍等..."><?php echo lang('login_submit_btn');?></button>
        
        <?php echo form_close();?>
        
        <p><a href="forgot_password"><?php echo lang('login_forgot_password');?></a></p>
    </div>
</div>

<?php $this->load->view('templates/footer');?>

<script>
$('button[data-loading-text]').on('click', function () {
        var btn = $(this)
        btn.button('loading')
        setTimeout(function () {
            btn.button('reset')
        }, 3000)
    });
</script>